package erfgame.core.memory;

public class ByteArray3DMemoryPool extends MemoryPool<byte[][][]> {
	
	private int width;
	private int height;
	private int depth;
	
	public ByteArray3DMemoryPool(int width, int height, int depth) {
		this.width = width;
		this.height = height;
		this.depth = depth;
	}

	@Override
	protected void clean(byte[][][] object) {
		for(int x = width; x>0; ) {
			x--;
			for(int y=height; y>0; ) {
				y--;
				for(int z=depth; z>0; ) {
					z--;
					object[x][y][z] = 0;
				}
			}
		}
	}

	@Override
	protected byte[][][] create() {
		return new byte[width][height][depth];
	}
}
